﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using NUnit.Framework;
using MoneyTrackin.com.moneytrackin.www;

namespace UnitTests
{
    [TestFixture]
    public class UnitTests
    {
        [Test]
        public void TestAddTransaction()
        {
            MoneyTrackin.Logic logic = MoneyTrackin.Logic.Instance;

            logic.AddTransaction("a", 1, DateTime.Now, "test");
            logic.AddTransaction("a", 2, DateTime.Now, "test");
            logic.AddTransaction("a", 3, DateTime.Now, "test");
            logic.AddTransaction("a", 4, DateTime.Now, "test");
            //logic.SubmitAllTransactions();
        }

        [Test]
        [Ignore]
        public void TestSubmitAllTransactions()
        {
            MoneyTrackin.Logic logic = MoneyTrackin.Logic.Instance;

            logic.SubmitAllTransactions();
            //logic.SubmitAllTransactions();
        }

        [Test]
        [Ignore]
        public void TestListProjects()
        {
            moneytrackinAPI api = new moneytrackinAPI();
            string list = api.listProjects(MoneyTrackin.ConfigurationSettings.Instance.Login,
                MoneyTrackin.ConfigurationSettings.MD5(
                    MoneyTrackin.ConfigurationSettings.Instance.Password));

        }

        [Test]
        public void ConfigToXML()
        {
            MoneyTrackin.ConfigurationSettings.Instance.Password = "pass";
            MoneyTrackin.ConfigurationSettings.Instance.Save();
            MoneyTrackin.ConfigurationSettings.Instance.ToString();
        }
    }
}
